/*
 * #%L
 * SwiftUIDataAccessLayer
 * $Id:$
 * $HeadURL:$
 * %%
 * Copyright (C) 2011 - 2012 Linkwithweb
 * %%
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as
 * published by the Free Software Foundation, either version 3 of the 
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public 
 * License along with this program.  If not, see
 * <http://www.gnu.org/licenses/gpl-3.0.html>.
 * #L%
 */
package com.linkwithweb.products.swiftui.rowmapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.linkwithweb.products.swiftui.dataobject.FrameworkTextReport;

/**
DROP TABLE IF EXISTS `automata`.`frm_text_report`;
CREATE TABLE  `automata`.`frm_text_report` (
  `REPORT_KEY` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `REPORT_ID` varchar(45) NOT NULL,
  `REPORT_NAME` varchar(45) NOT NULL,
  `TABLE_ID` varchar(45) NOT NULL,
  `REPORT_DESCRIPTION` varchar(45) NOT NULL,
  `REPORT_HEADING` varchar(45) NOT NULL,
  `REPORT_TYPE` varchar(45) NOT NULL,
  `FROZEN_COLUMN_COUNT` varchar(45) NOT NULL,
  `REPORT_DEFAULT_CSS` varchar(45) NOT NULL,
  `REPORT_DEFAULT_FILTER_STRING` varchar(45) NOT NULL,
  `IDENTIFIER` varchar(45) NOT NULL,
  `CREATED_BY` int(10) unsigned NOT NULL,
  `CREATED_DATE` datetime NOT NULL,
  `MODIFIED_BY` int(10) unsigned NOT NULL,
  `MODIFIED_DATE` datetime NOT NULL,
  `REPORT_SEARCH_ACTION` varchar(45) NOT NULL,
  PRIMARY KEY (`REPORT_KEY`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 * 
 *  This Class
 * Loads ReportComponet
 * 
 * @author ashwin
 * 
 */
public class ReportComponentRowMapper extends AbstractRowMapper  {

	public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
		FrameworkTextReport frameworkTextReport = new FrameworkTextReport();
		frameworkTextReport.setReportKey(rs.getLong("REPORT_KEY"));
		frameworkTextReport.setReportId(rs.getString("REPORT_ID"));
		frameworkTextReport.setReportName(rs.getString("REPORT_NAME"));
		frameworkTextReport.setTableId(rs.getString("TABLE_ID"));
		frameworkTextReport.setReportDescription(rs.getString("REPORT_DESCRIPTION"));
		frameworkTextReport.setReportHeading(rs.getString("REPORT_HEADING"));
		frameworkTextReport.setReportType(rs.getString("REPORT_TYPE"));
		frameworkTextReport.setFrozenColumnCount(rs.getInt("FROZEN_COLUMN_COUNT"));
		frameworkTextReport.setReportDefaultCss(rs.getString("REPORT_DEFAULT_CSS"));
		frameworkTextReport.setReportDefaultFilterString(rs.getString("REPORT_DEFAULT_FILTER_STRING"));
		frameworkTextReport.setEditable(rs.getBoolean("IS_EDITABLE"));
		frameworkTextReport.setMenuDisplayable(rs.getBoolean("IS_MENU_DISPLAYABLE"));
		
		
		return mapDefaultColumns(frameworkTextReport,rs);
	}

}